package com.imay.live.adapter;

import android.graphics.Color;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.imay.live.view.AutoAdjustRecylerView;
import com.imay.live.R;

/**
 * Created by chan on 2017/4/19.
 */
public class LabelAdapter extends BaseQuickAdapter<String, BaseViewHolder> {

    public LabelAdapter(AutoAdjustRecylerView recyclerView) {
        super(R.layout.item_label);
    }

    @Override
    protected void convert(BaseViewHolder helper, String item) {
        if (helper.getLayoutPosition() > 0) {

            helper.setText(R.id.tv_item_label, helper.getConvertView().getContext().getString(R.string.str_dynamics_jin_text, item));

            helper.setTextColor(R.id.tv_item_label, helper.getConvertView().getResources().getColor(R.color.text_30));
            helper.addOnClickListener(R.id.tv_item_label);

        } else if (helper.getLayoutPosition() == 0) {
            helper.setText(R.id.tv_item_label, item);
            helper.setTextColor(R.id.tv_item_label, helper.getConvertView().getResources().getColor(R.color.text_21));
        }
    }
}
